//全局路由守卫
import React from 'react';
import {useLocation,matchRoutes} from "react-router-dom";
import {routes} from "./index";
const GlobalRouterGuard = (props) => {
    const location = useLocation();
    const  matchs = matchRoutes(routes,location);
    const meta = matchs?.[matchs?.length-1]?.route?.meta; //默认为最后一个
    console.log("location", location,meta);
    return (
        <>
            {props.children}
        </>
    );
};

export default GlobalRouterGuard;